package com.springboot.common.constant;

/**
 * 系统错误代码枚举
 */
public enum ErrorCode {

    SUCCESS("0","成功"),
    ERROR("11","服务端程序执行异常，请检查"),
    ;

    private String code;

    private String message;

    private ErrorCode(String message) {
        this.message = message;
    }

    private ErrorCode(String code, String message) {
        this.code = code;
        this.message = message;
    }

    public String getCode() {
        return code == null ? this.name().substring(1) : code ;
    }

    public String getMessage() {
        return message;
    }

    public boolean equals(String errorCode){
        return this.code.equals(errorCode);
    }
}
